7.1 Introduction to JavaScript
- Motivations
- Try n-Puzzle Game.
- You have learned HTML and CSS. What else do you need to write the code for the above game?
- HTML and CSS are
- They are mostly descriptive languages.
- There are only a few limited ways to respond to user actions.
Do you rememeber :hover, :active, :target, and :checked pseudo classes?
- How to react to the selection of numbers, and clicking on buttons in n-puzzle game?
How to read user inputs and use them?
- What you need is
- You need a programming language.
- JavaScript
You can do the followings.
- Read user inputs.
- React to user activities, such as mouse move, click, keyboard, ...
- Control HTML elements
- ...
- Read all in JavaScript Introduction.
- What can you do with JavaScript?
- Reacting to events, such as mouse clicking
- Contents
- Attributes
- Styles, i.e., CSS properties
- The topics in JavaScript are beyond of this course.
If you are interested in JavaScript, you can continue studying with the next sections - 7.2, ..., at least 7.2.2.
- Lab 8.
- Learning outcomes